#pragma once
#include "State2.h"

class Application {
private:
	State* ConcreteState;

public:
	Application() :ConcreteState(nullptr) {};
	Application(State* concreteState) :
		ConcreteState(concreteState) {
	}

	void DoWork1() {
		if (ConcreteState != nullptr)
			ConcreteState->DoWork1();

		//获取下一个状态对象
		ConcreteState = ConcreteState->GetNext();
	}

	void DoWork2() {
		if (ConcreteState != nullptr)
			ConcreteState->DoWork2();

		//获取下一个状态对象
		ConcreteState = ConcreteState->GetNext();
	}

	//DoWork3 ...
};